/*
 * @Description: voxel_filter.hpp
 * @Author: Sang Hao
 * @Date: 2021-09-15 17:08:57
 * @LastEditTime: 2021-10-27 11:22:28
 * @LastEditors: Sang Hao
 */
#ifndef LIDAR_SLAM_MODELS_CLOUD_FILTER_VOXEL_FILTER_HPP_
#define LIDAR_SLAM_MODELS_CLOUD_FILTER_VOXEL_FILTER_HPP_

#include <pcl/filters/voxel_grid.h> 
#include <yaml-cpp/yaml.h>
#include "lidar_slam/models/cloud_filter/cloud_filter_interface.hpp"

namespace lidar_slam {
class VoxelFilter: public CloudFilterInterface {
private:
	/* data */
	pcl::VoxelGrid<CloudData::POINT> voxel_filter_;

private:
	bool SetFilterParam(float leaf_size_x, float leaf_size_y, float leaf_size_z);

public:
	VoxelFilter(const YAML::Node& config_node);
	VoxelFilter(float leaf_size_x, float leaf_size_y, float leaf_size_z);

	bool Filter(const CloudData::CLOUD_PTR& input_cloud_ptr, 
		CloudData::CLOUD_PTR& filter_cloud_ptr) override;
};
}

#endif